masterofmagicfandomcom-20200216-history
User blog:Drake178/Combat Spell Cursor Patch
By itself, this patch does the following: UI feature: combat spell targeting now also highlights the target tile for non-unit spells, if it is valid for the spell being cast UI feature: combat spell targeting has greatly improved responsiveness In addition, it fixes the cursor side of the following issues: "Wrack entity" crash bug (active Wall Crusher vs BU index #99 vs active Wrack) Summoning spells, Magic Vortex, Cracks Call, and Earth to Mud can be cast on tiles outside of the valid playfield Summoning Spells can be cast on wall corners and central structures Magic Vortex can be cast on central structures* Possession can be cast on Heroes The issue of whether Magic Vortex should be possible to cast on a central structure or not is a topic of debate among the patch-makers. In the official game (v1.31), a Vortex may not move into a tile occupied by a central structure, and this is the behaviour I've based this patch on, considering the bug to be the fact that it can still be summoned there nonetheless. However, even I have to admit that this lacks any semblance of common sense, as the Vortex is neither a unit, nor exactly physical in nature. A valid argument may possibly be made for Fortresses, Sorcery Nodes, and Nature Nodes, but these are a rather small subset of the possible central structures, none of which should prevent a Vortex from entering their tile. To accommodate both points of view, I have now highlighted the byte in the patch that needs changing for the cursor to display "valid" for a central structure tile when targeting Magic Vortex, and re-listed it separately at the bottom of this blog post, along with a patch (courtesy of Seravy), that will universally allow Magic Vortices to enter the tiles of central structures, both during their random movement phase, and while being moved by the player. Patch (WIZARDS.EXE, any version, one warning with CoM, needs the supplement for unit buff targeting below): ; use a different register for the window struct pointer 858B9 1E 3E 858BD 07 05 ; don't evaluate the normal cursor (over the bottom GUI) 858F3 6F 0B 858F4 01 02 ; save the target frame coordinates early 8591F 8A A3 85920 07 7E 85921 98 92 85922 3D 89 85923 FE 36 85924 FF 80 85925 74 92 85926 07 8A 85927 3D 07 85928 FF BA 85929 FF 03 8592A 74 00 ; get the wall targeting type out of the way early too 8592B 1E 3B 8592C EB 16 8592D 38 A6 8592E 83 C8 8592F 3E 75 85930 A6 15 85931 C8 FF 85932 0A 76 85933 7D F8 85934 0A 56 85935 8B 9A 85936 1E 57 85937 22 00 85938 C5 E0 85939 C7 03 8593A 07 59 8593B 02 59 8593C 00 83 8593D EB E8 8593E 08 03 8593F 8B F7 85940 1E D8 85941 22 89 85942 C5 05 85943 C7 E9 85944 07 BA 85945 03 01 ; fix the Wall Crusher targeting bug 85946 00 3C 85947 E9 24 85948 1A 0F 85949 01 82 8594A 83 C4 8594B 3E 00 ; empty tile branch - get the targeting type 8594C A6 A1 8594D C8 A6 8594E 0A C8 8594F 7D 3C 85950 0A 1E 85951 8B 75 85952 1E 2D ; Dispel Magic - only tiles with a Magic Vortex are valid 85953 22 33 85954 C5 C9 85955 C7 C4 85956 07 1E 85957 02 4E 85958 00 D1 85959 EB 8B 8595A 08 46 8595B 8B F8 8595C 1E EB 8595D 22 12 8595E C5 26 8595F C7 39 85960 07 37 85961 03 75 85962 00 09 85963 E9 26 85964 FE 39 85965 00 47 85966 C7 02 85967 06 75 85968 82 03 85969 92 E9 8596A 01 94 8596B 00 00 8596C 89 83 8596D 36 C3 8596E 80 0C 8596F 92 41 85970 8B 3B 85971 46 0E 85972 F8 52 85973 A3 D1 85974 7E 7C 85975 92 E8 85976 A1 E9 85977 80 88 85978 70 00 85979 40 90 8597A BB 90 8597B 03 90 8597C 00 90 8597D 99 90 8597E F7 90 8597F FB 90 ; all other unit targeting types are invalid now 85980 89 3C 85981 16 0A 85982 80 7D 85983 70 7D ; get the battlefield pointer and the tile offset 85984 8B 8B 85985 5E 4E 85986 F8 F8 85987 D1 6B 85988 E3 C9 85989 8B 15 8598A 9F 01 8598B 24 F1 8598C C5 C4 8598D 03 1E 8598E DE 74 8598F 8A 92 85990 07 01 85991 98 CB ; check if the tile is flyable 85992 89 26 85993 46 80 85994 FE BF 85995 8B 06 85996 46 09 85997 FE FF 85998 A3 75 85999 8A 0B ; if not, check if it's the central structure tile 8599A C5 80 8599B 8B F9 8599C 46 ED ; if not, it's invalid 8599D FE 75 8599E BA 62 ; if yes, it's valid for pure tile spells, and invalid otherwise 8599F 6E 3C 859A0 00 02 859A1 F7 75 ;7F ; change the above from 75 to 7F to display "valid" on the central ; structure tile for Magic Vortex 859A2 EA 5E 859A3 C4 EB 859A4 1E 5B ; flyable tile - valid for all but summons 859A5 2A 3C 859A6 92 02 859A7 03 7E 859A8 D8 57 ; attacker summons - right half of the map is valid 859A9 26 3C 859AA 80 04 859AB 7F 75 859AC 35 07 859AD 00 83 859AE 74 FE 859AF 45 0B 859B0 83 7D 859B1 3E 4E 859B2 A6 EB 859B3 C8 4D ; defender summons - right half of the map is invalid 859B4 0A 3C 859B5 74 05 859B6 2A 75 859B7 83 05 859B8 3E 83 859B9 A6 FE 859BA C8 0B 859BB 02 7D 859BC 74 44 ; finally, check for walls 859BD 23 29 859BE 83 CB 859BF 3E 26 859C0 A6 83 859C1 C8 BF 859C2 1E 56 859C3 74 15 859C4 1C 01 ; if no walls, all remaining tiles are valid 859C5 83 75 859C6 3E 39 ; otherwise check the corner tiles 859C7 A6 B8 859C8 C8 58 859C9 0B 15 859CA 75 81 859CB 1F F9 859CC 8B D7 859CD 46 00 859CE FE 74 859CF BA 1B 859D0 6E B8 859D1 00 5E 859D2 F7 15 859D3 EA 81 859D4 C4 F9 859D5 1E DA 859D6 2A 00 859D7 92 74 859D8 03 12 859D9 D8 B8 859DA 26 70 859DB 80 15 859DC 7F 81 859DD 0B F9 859DE 0F 16 859DF 7D 01 859E0 0A 74 859E1 8B 09 859E2 1E B8 859E3 22 76 859E4 C5 15 859E5 C7 81 859E6 07 F9 859E7 02 19 859E8 00 01 859E9 EB 75 859EA 08 08 859EB 8B 01 859EC 1E C3 859ED 22 26 859EE C5 80 859EF C7 3F 859F0 07 01 859F1 03 74 859F2 00 0E ; fixup space 859F3 EB EB 859F4 6D 0B 859F5 83 90 859F6 3E 90 859F7 A6 90 859F8 C8 90 859F9 14 90 859FA 74 90 859FB 54 90 859FC 83 90 859FD 3E 90 859FE A6 90 859FF C8 90 ; valid target collector 85A00 02 4A ; invalid target collector 85A01 74 89 85A02 4D 15 85A03 83 E9 85A04 3E FA 85A05 A6 00 ; fixup space 85A06 C8 90 85A07 1E 90 85A08 74 90 85A09 46 90 85A0A 83 90 85A0B 3E 90 85A0C A6 90 85A0D C8 90 85A0E 15 90 85A0F 75 90 ; tile with unit branch - mark the cursor unit 85A10 15 98 85A11 8B A3 85A12 46 8A 85A13 FE C5 ; enable the targeting frame regardless of validity 85A14 BA C6 85A15 6E 06 85A16 00 82 85A17 F7 92 85A18 EA 01 ; get the battle unit pointer 85A19 C4 6B 85A1A 1E C0 85A1B 2A 6E 85A1C 92 C4 85A1D 03 1E 85A1E D8 2A 85A1F 26 92 85A20 80 03 85A21 7F D8 ; get the targeting type 85A22 0B A1 85A23 0F A6 85A24 7C C8 ; pure tile targeting is always valid here 85A25 2A 3C 85A26 83 02 85A27 3E 74 85A28 A6 D7 ; other tile targeting types never are 85A29 C8 3C 85A2A 17 0A 85A2B 75 7C 85A2C 2D D4 ; dispel types also always are 85A2D 8B 3C 85A2E 46 1E 85A2F FE 74 85A30 BA CF ; branch off if the unit is friendly 85A31 6E 26 85A32 00 80 85A33 F7 7F 85A34 EA 35 85A35 C4 00 85A36 1E 74 85A37 2A 27 ; universal enemy unit targeting is now always valid 85A38 92 3C 85A39 03 0A 85A3A D8 74 85A3B 26 C4 ; friendly targeting is not 85A3C 8B 3C 85A3D 47 0C 85A3E 30 7F 85A3F B1 C1 85A40 05 74 85A41 D3 3D ; normal unit common branch - valid if normal race 85A42 E0 26 85A43 C4 80 85A44 1E 7F 85A45 C2 0B 85A46 9E 0F 85A47 03 7C 85A48 D8 B7 85A49 26 26 ;EB ; replace above with EB to disallow targeting Torin 85A4A 80 8B ;B6 ; replace above with B6 to disallow targeting Torin 85A4B 7F 47 85A4C 06 30 85A4D FF C1 85A4E 7E E0 85A4F 0A 05 85A50 8B C4 85A51 1E 1E 85A52 22 C2 85A53 C5 9E 85A54 C7 03 85A55 07 D8 85A56 02 26 85A57 00 80 85A58 EB 7F 85A59 08 05 85A5A 8B 22 85A5B 1E 74 85A5C 22 A3 85A5D C5 EB 85A5E C7 A2 ; friendly unit branch - enemy targeting invalid now 85A5F 07 3C 85A60 03 14 85A61 00 74 85A62 EB 9D 85A63 00 7C 85A64 83 9C ; for normal units, take the common branch 85A65 3E 3C 85A66 A6 15 85A67 C8 74 85A68 04 D9 ; only hero targeting left - check if the unit is one 85A69 75 26 85A6A 0D 8B 85A6B 83 47 85A6C FE 30 85A6D 0B C1 85A6E 7D E0 85A6F 08 05 85A70 8B C4 85A71 1E 1E 85A72 22 C2 85A73 C5 9E 85A74 C7 03 85A75 07 D8 85A76 03 26 85A77 00 80 85A78 83 7F 85A79 3E 06 85A7A A6 FF ; if not a hero, targeting is not valid 85A7B C8 7E 85A7C 05 84 ; otherwise it is 85A7D 75 EB 85A7E 0D 81 ; Possession - check if the target is a hero 85A7F 83 06 85A80 FE 53 85A81 0A 26 85A82 7E 8B 85A83 08 47 85A84 8B 30 85A85 1E C1 85A86 22 E0 85A87 C5 05 85A88 C7 C4 85A89 07 1E 85A8A 03 C2 85A8B 00 9E 85A8C 83 03 85A8D 3E D8 85A8E A6 26 85A8F C8 8A 85A90 03 47 85A91 75 06 85A92 1F 5B 85A93 8B 07 85A94 1E 08 85A95 22 C0 ; jump to the normal unit check if it isn't 85A96 C5 7C 85A97 C7 AA ; but it's invalid for Possession if it is 85A98 07 E9 85A99 03 66 85A9A 00 FF ; 101 empty bytes 85A9B FF 90 85A9C 76 90 85A9D F8 90 85A9E 56 90 85A9F 9A 90 85AA0 57 90 85AA1 00 90 85AA2 E0 90 85AA3 03 90 85AA4 59 90 85AA5 59 90 85AA6 0B 90 85AA7 C0 90 85AA8 74 90 85AA9 08 90 85AAA 8B 90 85AAB 1E 90 85AAC 22 90 85AAD C5 90 85AAE C7 90 85AAF 07 90 85AB0 02 90 85AB1 00 90 85AB2 83 90 85AB3 3E 90 85AB4 A6 90 85AB5 C8 90 85AB6 1E 90 85AB7 75 90 85AB8 3B 90 85AB9 33 90 85ABA FF 90 85ABB EB 90 85ABC 31 90 85ABD 8B 90 85ABE C7 90 85ABF BA 90 85AC0 0C 90 85AC1 00 90 85AC2 F7 90 85AC3 EA 90 85AC4 C4 90 85AC5 1E 90 85AC6 4E 90 85AC7 D1 90 85AC8 03 90 85AC9 D8 90 85ACA 26 90 85ACB 39 90 85ACC 37 90 85ACD 75 90 85ACE 1E 90 85ACF 8B 90 85AD0 C7 90 85AD1 BA 90 85AD2 0C 90 85AD3 00 90 85AD4 F7 90 85AD5 EA 90 85AD6 C4 90 85AD7 1E 90 85AD8 4E 90 85AD9 D1 90 85ADA 03 90 85ADB D8 90 85ADC 26 90 85ADD 8B 90 85ADE 47 90 85ADF 02 90 85AE0 3B 90 85AE1 46 90 85AE2 F8 90 85AE3 75 90 85AE4 08 90 85AE5 8B 90 85AE6 1E 90 85AE7 22 90 85AE8 C5 90 85AE9 C7 90 85AEA 07 90 85AEB 02 90 85AEC 00 90 85AED 47 90 85AEE 3B 90 85AEF 3E 90 85AF0 52 90 85AF1 D1 90 85AF2 7C 90 85AF3 C9 90 85AF4 8B 90 85AF5 1E 90 85AF6 22 90 85AF7 C5 90 85AF8 83 90 85AF9 3F 90 85AFA 02 90 85AFB 75 90 85AFC 0C 90 85AFD A1 90 85AFE FC 90 85AFF C8 90 ; always step both animation frames 85B00 05 A1 85B01 09 80 85B02 00 70 85B03 8B 40 85B04 1E 83 85B05 22 F8 85B06 C5 03 85B07 89 7C 85B08 07 02 85B09 A1 33 85B0A FC C0 85B0B C8 A3 85B0C 40 80 85B0D BB 70 85B0E 05 A1 85B0F 00 FC 85B10 99 C8 85B11 F7 89 85B12 FB C2 85B13 89 40 85B14 16 83 85B15 FC F8 85B16 C8 05 85B17 8B 7C 85B18 1E 02 85B19 22 33 85B1A C5 C0 85B1B C7 A3 85B1C 47 FC 85B1D 02 C8 85B1E 02 90 85B1F 00 90 85B20 8B 90 85B21 1E 90 85B22 22 90 85B23 C5 90 ; if the cursor is the spellcasting one, animate it 85B24 C7 83 85B25 47 3D 85B26 04 02 85B27 00 75 85B28 00 0A 85B29 8B 83 85B2A 1E C2 85B2B 22 09 85B2C C5 89 85B2D C7 15 ; also enforce the targeting frame in this case 85B2E 47 C6 85B2F 06 06 85B30 00 82 85B31 00 92 85B32 8B 01 ; simplify the window structure setup 85B33 1E 57 85B34 22 1E 85B35 C5 07 85B36 C7 47 85B37 47 47 85B38 08 B8 85B39 3F 02 85B3A 01 00 85B3B 8B AB 85B3C 1E 31 85B3D 22 C0 85B3E C5 AB 85B3F C7 AB 85B40 47 B8 85B41 0A 3F 85B42 C7 01 85B43 00 AB 85B44 FF B8 85B45 36 C7 85B46 22 00 85B47 C5 AB ; condense the direct (spell type -> targeting type) conversions 85C4C C7 B0 85C4D 06 0A 85C4E A6 EB 85C4F C8 16 85C50 0A B0 85C51 00 0B ; insert a branch for Possession to use a new type (12) 85C52 E9 81 85C53 B9 FE 85C54 00 AC 85C55 C7 00 85C56 06 75 85C57 A6 0E 85C58 C8 B0 85C59 0B 0C 85C5A 00 EB 85C5B E9 0A 85C5D 00 1E 85C5E C7 EB 85C60 A6 B0 85C61 C8 14 85C62 1E EB 85C63 00 02 85C64 E9 B0 85C65 A7 15 85C66 00 32 85C67 C7 E4 85C68 06 A3 85C6B 14 90 85C6C 00 90 ; improve combat spell targeting responsiveness 86925 02 01 ; disable the targeting rectangle when finished 8693A B8 C6 8693B 02 06 8693C 00 82 8693D 50 92 8693E B8 00 8693F 18 6A 86940 03 02 86941 50 68 86942 B8 18 86943 20 03 86944 00 6A 86945 50 20 ; adjust the switch jumps 8695B B7 B0 86977 C0 B4 86979 A5 A0 8697D AE AC ; relocation 8852F F2 88 88530 01 00 885ED 8F 92 CoM Normal Units CoM normal unit buff targeting supplement: ; CoM NU Buffs - get the unit pointer first 85A65 3C 26 85A66 15 8B 85A67 74 4F 85A68 D9 30 85A69 26 C1 85A6A 8B E1 85A6B 47 05 85A6C 30 C4 85A6D C1 1E 85A6E E0 C2 85A6F 05 9E 85A70 C4 03 85A71 1E D9 ; for normal units, jump to the CoM only branch 85A72 C2 3C 85A73 9E 15 85A74 03 74 85A75 D8 25 ; CoM NU check - unit type instead of race byte 85A9B 90 26 85A9C 90 80 85A9D 90 7F 85A9E 90 05 85A9F 90 99 85AA0 90 0F 85AA1 90 82 85AA2 90 5C 85AA3 90 FF 85AA4 90 E9 85AA5 90 5A 85AA6 90 FF Code: $858B8: 8b 3e 22 c5 mov di, 0xc522 //GUI_CombatWindow@ c7 05 01 00 mov di, 1 // Crsr_Normal $858F2: e9 .. .. jmp $85B00 // cursor over GUI skip $8591F: (ax - cursor tile Y, si - cursor tile X, bx - GUI_TargetRowsX,Y@, di - see above) a3 7e 92 mov 0x927e, ax //GUI_TargetFrame_Y 89 36 80 92 mov 0x9280, si //GUI_TargetFrame_X 8a 07 mov al, bx ba 03 00 mov dx, 3 // Crsr_RedCross, CTT_Wall 3b 16 a6 c8 cmp dx, 0xc8a6 //GUI_CmbTargetType 75 15 jnz +21 ff 76 f8 push bp-8 //Y_Pos 56 push si 9a 57 00 e0 03 call TILE_HasIntactWall() // reloc :01F2 -> :0088 59 pop cx 59 pop cx 83 e8 03 sub ax, 3 // 0 -> 3; 1 -> 2 f7 d8 neg ax 89 05 mov di, ax e9 .. .. jmp $85B00 3c 24 cmp al, 36 // "wrack entity" bugfix 0f 82 .. .. jb UNIT_TILE EMPTY_TILE: a1 a6 c8 mov ax, 0xc8a6 //GUI_CmbTargetType 3c 1e cmp al, 30 // CTT_DispelMagic 75 .. jnz .. 33 c9 xor cx, cx c4 1e 4e d1 les bx, 0xd14e //Vortex_Table@ 8b 46 f8 mov ax, bp-8 //Y_Pos eb 12 jmp +18 // condition check first 26 39 37 cmp es:bx, si //.X_Pos 75 09 jnz +9 26 39 47 02 cmp es:bx+2, ax //.Y_Pos 75 03 jnz +3 e9 .. .. jmp VALID 83 c3 0c add bx, 12 41 inc cx 3b 0e 52 d1 cmp cx, 0xd152 //GUI_VortexCount 7c e8 jl -24 e9 .. .. jmp INVALID 3c 0a cmp al, 10 // CTT_EnemyUnit 7d .. jge INVALID 8b 4e f8 mov cx, bp-8 //Y_Pos 6b c9 15 imul cx, 21 01 f1 add cx, si c4 1e 74 92 les bx, 0x9274 //Battlefield@ 01 cb add bx, cx 26 80 bf 06 09 ff cmp es:bx+0x906, -1 // (flight map) 75 0b jnz MOVABLE 80 f9 ed cmp cl, 237 // 6,11 75 .. jnz INVALID 3c 02 cmp al, 2 // CTT_Tile 75 .. jnz INVALID eb .. jmp VALID MOVABLE: 3c 02 cmp al, 2 // CTT_Tile 7e .. jle VALID 3c 04 cmp al, 4 // CTT_Tile_ASummon 75 07 jnz +7 83 fe 0b cmp si, 11 7d .. jge VALID eb .. jmp INVALID 3c 05 cmp al, 5 // CTT_Tile_DSummon 75 05 jnz +5 83 fe 0b cmp si, 11 7d .. jge INVALID 29 cb sub bx, cx 26 83 bf 56 15 01 cmp es:bx+1556, 1 //.Walled_City 75 .. jnz VALID b8 58 15 mov ax, 0x1558 81 f9 d7 00 cmp cx, 0xd7 74 1b jz CHECK b8 5e 15 mov ax, 0x155e 81 f9 da 00 cmp cx, 0xda 74 12 jz CHECK b8 70 15 mov ax, 0x1570 81 f9 16 01 cmp cx, 0x116 74 09 jz CHECK b8 76 15 mov ax, 0x1576 81 f9 19 01 cmp cx, 0x119 75 08 jnz VALID CHECK: 01 c3 add bx, ax 26 80 3f 01 cmp es:bx, 1 74 01 jz INVALID VALID: $B5A00 4a dec dx INVALID: $B5A01 89 15 mov di, dx e9 .. .. jmp $85B00 UNIT_TILE: $B5A10 98 cbw a3 8a c5 mov 0xc58a, ax //GUI_CursorBattleUnit c6 06 82 92 01 mov 0x9282, 1 //GUI_TargetFrame 6b c0 6e imul ax, 0x6e c4 1e 2a 92 les bx, 0x922a 03 d8 add bx, ax a1 a6 c8 mov ax, 0xc8a6 //GUI_CmbTargetType 3c 02 cmp al, 2 // CTT_Tile 74 .. jz VALID 3c 0a cmp al, 10 // CTT_EnemyUnit 7c .. jl INVALID 3c 1e cmp al, 30 // CTT_DispelMagic 74 .. jz VALID 26 80 7f 35 00 cmp es:bx+0x35, 0 //.Owner, Human_Player 74 .. jz FRIENDLY 3c 0a cmp al, 10 // CTT_EnemyUnit 74 .. jz VALID 3c 0c cmp al, 12 // CTT_Possession 7f .. jg INVALID 74 .. jz POSSESSION NUCHECK: $85A42 26 80 7f 0b 0f cmp es:bx+0x0b, 15 //.Race, R_Arcane 7c .. jl VALID 26 8b 47 30 mov ax, es:bx+0x30 //Unit_Index c1 e0 05 shl ax, 5 c4 1e c2 9e les bx, 0x9ec2 //Unit_Table@ 03 d8 add bx, ax 26 80 7f 05 22 cmp es:bx+5, 22 //.Unit_Type, _Chosen 74 .. jz VALID eb .. jmp INVALID FRIENDLY: 3c 14 cmp al, 20 // CTT_FriendlyUnit 74 .. jz VALID 7c .. jl INVALID 3c 15 cmp al, 21 // CTT_FriendlyNU 74 .. jz NUCHECK // v1.31-v1.51 branching 26 8b 47 30 mov ax, es:bx+0x30 //Unit_Index (cx in CoM) c1 e0 05 shl ax, 5 c4 1e c2 9e les bx, 0x9ec2 //Unit_Table@ 03 d8 add bx, ax //3c 15 cmp al, 21 // CTT_FriendlyNU //74 .. jz FRIENDLYNU // CoM branching 26 80 7f 06 ff cmp es:bx+6, -1 //.Hero_Slot 7e .. jle INVALID eb .. jmp VALID POSSESSION: $85A7F 06 push es 53 push bx 26 8b 47 30 mov ax, es:bx+0x30 //Unit_Index c1 e0 05 shl ax, 5 c4 1e c2 9e les bx, 0x9ec2 //Unit_Table@ 03 d8 add bx, ax 26 8a 47 06 mov al, es:bx+6 //.Hero_Slot 5b pop bx 07 pop es 08 c0 or al, al 7c .. jl NUCHECK e9 .. .. jmp INVALID FRIENDLYNU: (CoM only, $85A9B) 26 80 7f 05 99 cmp es:bx+5, 0x99 //.Unit_Type 0f 82 .. .. jb VALID e9 .. .. jmp INVALID $85B00: a1 80 70 mov ax, 0x7080 //GUI_SelFrameStage 40 inc ax 83 f8 03 cmp ax, 3 7c 02 jl +2 33 c0 xor ax, ax a3 80 70 mov 0x7080, ax //GUI_SelFrameStage a1 fc c8 mov ax, 0xc8fc //GUI_CC_AnimStage 89 c2 mov dx, ax 40 inc ax 83 f8 05 cmp ax, 5 7c 02 jl +2 33 c0 xor ax, ax a3 fc c8 mov 0xc8fc, ax //GUI_CC_AnimStage 90 90 90 90 90 90 83 3d 02 cmp di, 2 75 0a jnz +10 83 c2 09 add dx, 9 89 15 mov di, dx c6 06 82 92 01 mov 0x9282, 1 //GUI_TargetFrame 57 push di 1e push ds 07 pop es 47 inc di 47 inc di b8 02 00 mov ax, 2 ab stosw 31 c0 xor ax, ax ab stosw ab stosw b8 3f 01 mov ax, 319 ab stosw b8 c7 00 mov ax, 199 ab stosw $85C4C: b0 0a mov al, 10 eb 16 jmp SET :03A5 -> :03A0 b0 0b mov al, 11 81 fe ac 00 cmp si, 0xac 75 0e jnz SET b0 0c mov al, 12 eb 0a jmp SET :03AE -> :03AC b0 1e mov al, 30 eb 06 jmp SET :03B7 -> :03B0 b0 14 mov al, 20 eb 02 jmp SET :03C0 -> :03B4 b0 15 mov al, 21 SET: 32 e4 xor ah, ah a3 a6 c8 mov 0xc8a6, ax e9 .. .. jmp $85D0E $8693A: c6 06 82 92 00 mov 0x9282, 0 //GUI_TargetFrame 6a 02 push 2 68 18 03 push seg stub099 // reloc :108F -> 1092 6a 20 push 32 wall corner/tile offset pairs 0x1558 0xd7 0x155e 0xda 0x1570 0x116 0x1576 0x119 0xed = central structure tile CS Wall OffScrn Vortex No Yes No Tile Yes Yes No Summon No No No enum Cursor_Types { Crsr_None = 0, Crsr_Normal, Crsr_CastBase, Crsr_RedCross, Crsr_Ranged, Crsr_Melee, Crsr_Hourglass, Crsr_MoveHat, Crsr_Empty, Crsr_CastAnim1, Crsr_CastAnim2, Crsr_CastAnim3, Crsr_CastAnim4, Crsr_CastAnim5, }; enum Cmbt_Targeting_Types { CTT_Tile_NoUnit = 1, CTT_Tile, CTT_Wall, CTT_Tile_NoUnitA, CTT_Tile_NoUnitD, CTT_EnemyUnit = 10, CTT_EnemyNU, CTT_Possession, // (new) CTT_FriendlyUnit = 20, CTT_FriendlyNU, CTT_FriendlyHero = 23, CTT_DispelMagic = 30, }; Magic Vortex Magic Vortex supplement - byte change to allow targeting central structures: 859A1 75 7F Magic Vortex patch - allow the Vortex to move into central structure tiles (full, including cursor): ; Magic vortex can enter the central structure tile (to make consistent with the summoning.) AF7F8 16 09 AF7F9 8B 26 AF7FA C6 8B AF7FB BA 47 AF7FC 0C 02 AF7FD 00 3B AF7FE F7 46 AF7FF EA FA AF800 C4 74 AF801 1E 7B AF802 4E 8B AF803 D1 46 AF804 03 FA AF805 D8 BA AF806 26 15 AF807 8B 00 AF808 47 F7 AF809 02 EA AF80A 3B 03 AF80B 46 C7 AF80C FA 3D AF80D 74 ED AF80E 6E 00 AF80F 8B 74 AF810 46 16 AF811 FA 90 AF812 BA 90 AF813 15 90 AF814 00 90 AF815 F7 90 AF816 EA 90 AF81D 03 90 AF81E DF 90 AF983 16 09 AF984 8B 26 AF985 C6 8B AF986 BA 47 AF987 0C 02 AF988 00 3B AF989 F7 46 AF98A EA F4 AF98B C4 74 AF98C 1E 75 AF98D 4E 8B AF98E D1 46 AF98F 03 F4 AF990 D8 BA AF991 26 15 AF992 8B 00 AF993 47 F7 AF994 02 EA AF995 3B 03 AF996 46 C7 AF997 F4 3D AF998 74 ED AF999 68 00 AF99A 8B 74 AF99B 46 16 AF99C F4 90 AF99D BA 90 AF99E 15 90 AF99F 00 90 AF9A0 F7 90 AF9A1 EA 90 AF9A8 03 90 AF9A9 DF 90 AFA95 8B EB AFA96 C6 0B AFA97 BA 3D AFA98 0C ED AFA9A F7 74 AFA9B EA 6E AFA9C C4 EB AFA9D 1E 5E AFA9E 4E 90 AFA9F D1 90 AFAA0 03 90 AFAA1 D8 90 AFAF2 8B B8 AFAF3 46 15 AFAF4 FC 00 AFAF5 BA F7 AFAF6 15 6E AFAF7 00 FC AFAF8 F7 03 AFAF9 EA C7 AFAFA C4 EB AFAFB 1E 9B AFAFC 74 C4 AFAFD 92 1E AFAFE 03 74 AFAFF D8 92 AFB01 DF D8 Category:Blog posts